/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TimeRecording.enums;

/**
 *
 * @author david
 */
public enum PatternType {

    // The total hours that must be worked, specified on a by-day basis
    DAILY_PAID_TIME("Daily"),

    // These are core hours during which an employee must be "clocked in"
    CLOCKING_TIME("Clocked"),

    // The total hours that must be worked, specified on a by-week basis
    // (the manner in which the time is accrued is flexible within the week)
    WEEKLY_PAID_TIME("Week Flexi"),

    // The total hours that must be worked, specified on a by-week
    // basis but credits and debits can be carried from week-to-week,
    // month-to-month or even year-to-year
    FLEXI_PAID_TIME("Full Flexi"),

    // Specifies specifc hours to be worked
    SESSIONAL_TIME("Sessional"),

    // A catch-all for sessional workers.
    AD_HOC_TIME("Ad Hoc Sessional");

    private String description;

    private PatternType(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return description;
    }

    public static PatternType fromString(String match) {
        for (PatternType candidate : values()) {
            if (candidate.description.equals(match)) {
                return candidate;
            }
        }
        return valueOf(match);
    }
}